x86/p2m: pass old PTE directly to write_p2m_entry_pre() hook
authorJan Beulich <jbeulich@suse.com>
Fri, 8 Jan 2021 15:50:11 +0000 (16:50 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 8 Jan 2021 15:50:11 +0000 (16:50 +0100)
commit8511cc9eac78fa2d0f6ffc76ba80e55a06d02e78
tree942f085abf8da01cc8f6b4cdb0a7a904d7f7798d
parent570065b9d5a8a00c5c1aab9e13e9e1ad3e35ce7d
x86/p2m: pass old PTE directly to write_p2m_entry_pre() hook

In no case is a pointer to non-const needed. Since no pointer arithmetic
is done by the sole user of the hook, passing in the PTE itself is quite
fine.

While doing this adjustment also
- drop the intermediate sh_write_p2m_entry_pre():
  sh_unshadow_for_p2m_change() can itself be used as the hook function,
  moving the conditional into there,
- introduce a local variable holding the flags of the old entry.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Tim Deegan <tim@xen.org>
xen/arch/x86/mm/p2m-pt.c
xen/arch/x86/mm/shadow/common.c
xen/include/asm-x86/p2m.h